<?php 
namespace frontend\models;
use common\models\User;
use yii\db\ActiveReCord;
use yii\helpers\ArrayHelper;
/**
 * 
 */
class Region extends ActiveRecord
{
    
    public static function getRegion($parentId=0)
    {
        $result = static::find()->where(['parent_id'=>$parentId])->asArray()->all();
        return ArrayHelper::map($result, 'id', 'name');
    }
}

